//
//  NSProgressMgExplicitly.m
//  NSProgress
//
//  Created by 韩艳锋 on 2021/11/15.
//

#import "NSProgressMgExplicitly.h"

@implementation NSProgressMgExplicitly

- (instancetype)init {
    self = [super init];
    if (self) {
        [self startLongOperation];
    }
    return self;
}

- (void)startLongOperation {
    self.progress1 = [NSProgress progressWithTotalUnitCount:_totalProgress1];
    self.progress2 = [NSProgress progressWithTotalUnitCount:_totalProgress2];
    self.progress3 = [NSProgress progressWithTotalUnitCount:_totalProgress3];
    
    [self.progress1 addChild:self.progress2 withPendingUnitCount:_pendingUnitCount1];
    [self.progress1 addChild:self.progress3 withPendingUnitCount:_totalProgress1 - _pendingUnitCount1];
}

@end
